package com.Li.spring.pojo;

import java.util.Arrays;
import java.util.Map;
import java.util.Objects;

public class Student {

    private Integer sid;
    private String name;
    private Integer age;
    private String gender;
    private Double score;
    private Clazz clazz;
    private String[] hobby;
    private Map<String, Teacher> teacherMap;

    public Student(Integer sid, String name, Integer age, String gender, Double score, Clazz clazz) {
        this.sid = sid;
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.score = score;
        this.clazz = clazz;
    }

    public Student(Integer sid, String name, Integer age, String gender, Double score, Clazz clazz, String[] hobby, Map<String, Teacher> teacherMap) {
        this.sid = sid;
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.score = score;
        this.clazz = clazz;
        this.hobby = hobby;
        this.teacherMap = teacherMap;
    }

    public Student(Integer sid, String name, Integer age, String gender, Double score, Clazz clazz, String[] hobby) {
        this.sid = sid;
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.score = score;
        this.clazz = clazz;
        this.hobby = hobby;
    }

    public Student() {
    }

    public Student(Integer sid, String name, String gender, Integer age) {
        this.sid = sid;
        this.name = name;
        this.age = age;
        this.gender = gender;
    }


    public Map<String, Teacher> getTeacherMap() {
        return teacherMap;
    }

    public void setTeacherMap(Map<String, Teacher> teacherMap) {
        this.teacherMap = teacherMap;
    }

    public String[] getHobby() {
        return hobby;
    }

    public void setHobby(String[] hobby) {
        this.hobby = hobby;
    }

    public Clazz getClazz() {
        return clazz;
    }

    public void setClazz(Clazz clazz) {
        this.clazz = clazz;
    }

    public Student(Integer sid, String name, String gender, Double score) {
        this.sid = sid;
        this.name = name;
        this.gender = gender;
        this.score = score;
    }

    public Double getScore() {
        return score;
    }

    public void setScore(Double score) {
        this.score = score;
    }

    public Integer getSid() {
        return sid;
    }

    public void setSid(Integer sid) {
        this.sid = sid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    @Override
    public String toString() {
        return "Student{" +
                "sid=" + sid +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                ", score=" + score +
                ", clazz=" + clazz +
                ", hobby=" + Arrays.toString(hobby) +
                ", teacherMap=" + teacherMap +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return Objects.equals(sid, student.sid) && Objects.equals(name, student.name) && Objects.equals(age, student.age) && Objects.equals(gender, student.gender) && Objects.equals(score, student.score) && Objects.equals(clazz, student.clazz) && Arrays.equals(hobby, student.hobby) && Objects.equals(teacherMap, student.teacherMap);
    }

    @Override
    public int hashCode() {
        int result = Objects.hash(sid, name, age, gender, score, clazz, teacherMap);
        result = 31 * result + Arrays.hashCode(hobby);
        return result;
    }
}
